#/bin/sh
crontab_file="/var/spool/cron/root"

if [[ ! -e $crontab_file ]]; then
    touch $crontab_file 
fi

#ssed -i '/clean_expired_file.sh/d' $crontab_file

#start clean expired file, at 02:30:00 

grep -q "clean_expired_file.sh" $crontab_file
if [ "$?" != "0" ] ; then
    echo "30 2 * * * /var/csv/script/clean_expired_file.sh /var/csv-data/metadata/cam_info" >> $crontab_file
fi
